//
//  HNSH_GroupAdminHeaderView.m
//  HNSH_SingleProject
//
//  Created by 李宇廷 on 2023/2/18.
//

#import "HNSH_GroupAdminHeaderView.h"

@interface HNSH_GroupAdminHeaderView ()

/* iconImgV */
@property (nonatomic, strong) UIImageView *iconImgV;
/** */
@property (nonatomic, strong)UILabel * titleLabel;
/** */
@property (nonatomic, strong)UILabel * secLabel;

@end

@implementation HNSH_GroupAdminHeaderView

//MARK: Cycle Methods
- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        self.backgroundColor = [UIColor appWhiteLabelColor];
        [self addAllViews];
        [self addAllLayout];
    }
    return self;
}

//MARK: Myself Methods
- (void)addAllViews{
    [self addSubview:self.titleLabel];
    [self addSubview:self.secLabel];
    [self addSubview:self.iconImgV];
    
}

- (void)addAllLayout{
    [self.iconImgV mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self.mas_centerX);
        make.width.mas_equalTo(60);
        make.height.mas_equalTo(62);
        make.top.mas_equalTo(16);
    }];
    [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.mas_equalTo(self);
        make.top.mas_equalTo(80);
        make.height.mas_equalTo(25);
    }];
    [self.secLabel setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisVertical];
    [self.secLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(28);
        make.top.mas_equalTo(self.titleLabel.mas_bottom).offset(20);
        make.right.mas_equalTo(-28);
    }];
    
}

//MARK: Getter Methods
- (UIImageView *)iconImgV {
    if (!_iconImgV) {
        _iconImgV = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"chat_qun_guanli_icon_qunguanli"]];
    }
    return _iconImgV;
}

- (UILabel *)titleLabel{
    if (!_titleLabel) {
        _titleLabel = [UILabel new];
        _titleLabel.font = [UIFont boldSystemFontOfSize:18];
        _titleLabel.textColor = [UIColor appBlackLabelColor];
        _titleLabel.textAlignment = NSTextAlignmentCenter;
        _titleLabel.text = @"群管理员";
    }
    return _titleLabel;
}

- (UILabel *)secLabel{
    if (!_secLabel) {
        _secLabel = [UILabel new];
        _secLabel.font = [UIFont systemFontOfSize:14];
        _secLabel.textColor = [UIColor colorWithHexString:@"#666666"];
        _secLabel.numberOfLines = 0;
        _secLabel.text = @"群管理员权限：\n1.发表群公告\n2.设置进群方式，并可通过/拒绝群申请\n3.移除群成员\n4.修改群名称";
    }
    return _secLabel;
}

@end
